package juc.threadlocal;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author fangbin
 * @desc
 * @date 2020/5/20 20:01
 */
public class ThreadLocalNormalUsafe {

    public static void main(String[] args) {
       new Thread(new Runnable() {
           @Override
           public void run() {
              String date = new ThreadLocalNormalUsafe().date(10);
               System.out.println(date);
           }
       }).start();
        new Thread(new Runnable() {
            @Override
            public void run() {
                String date = new ThreadLocalNormalUsafe().date(1007);
                System.out.println(date);
            }
        }).start();
    }

    public String date(int seconds){
        Date date = new Date(1000*seconds);
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");

        return dateFormat.format(date);
    }
}
